"""
GIL: 全局解释器锁
得到了GIL锁就会去执行代码


CPU密集型：加减乘除 有负担， 线程切换的负担

join: 线程同步
"""

import threading
import time


start = time.time()
def foo():
    num = 0
    for i in range(10000):
        num += 1
        print("我是1号")


def foo2():
    num = 0
    for i in range(10000):
        num += 1
        print("我是2号")


t1 = threading.Thread(target=foo)
t2 = threading.Thread(target=foo2)
t1.start()
t2.start()
t1.join()
t2.join()
print("执行完毕", time.time() - start)
